#include<iostream>
#include<vector>
#include<memory>

std::vector<int>* func1()
{
	return new std::vector<int>;
}

void func2(std::vector<int>* v)
{
	int i = 0;
	while (std::cin >> i)
	{
		v->push_back(i);
	}
}

void func3(std::vector<int>* v)
{
	for (auto c : *v)
		std::cout << c << std::endl;
	delete v;
}

std::shared_ptr<std::vector<int>> Func1()
{
	std::shared_ptr<std::vector<int>> sv = std::make_shared<std::vector<int>>();

	return sv;
}

void Func2(std::shared_ptr<std::vector<int>> &sv)
{
	int i = 0;
	while (std::cin >> i)
	{
		sv->push_back(i);
	}
}

void Func3(std::shared_ptr<std::vector<int>> &sv)
{
	for (auto c : *sv)
	{
		std::cout << c << std::endl;
	}
}

int main()
{
	std::vector<int>* v = func1();
	func2(v);
	func3(v);

	return 0;
}